package be.webchess.www.actions;

import java.sql.Connection;
import java.sql.DriverManager;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;
import org.apache.tiles.TilesContainer;
import org.apache.tiles.access.TilesAccess;

import com.opensymphony.xwork2.ActionSupport;

public class ActionHelper extends ActionSupport {

	protected HttpServletRequest 	request;
	protected HttpServletResponse 	response;
	protected TilesContainer 		tiles;
	protected Connection			connection;
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 3530076723128499504L;

	public ActionHelper() {
		super();
		
        ServletContext servletContext = ServletActionContext.getServletContext();
        tiles = TilesAccess.getContainer(servletContext);
        
        request = ServletActionContext.getRequest();
        response = ServletActionContext.getResponse();	
        
        try 
        {
        	Class.forName("com.mysql.jdbc.Driver");
        	
        	connection = DriverManager.getConnection("jdbc:mysql://localhost/webchess_beta?user=root&password=test1");
        } catch ( Exception ex  )
        {
        }
	}

}
